<!--

    Copyright (C) 2015 The Gravitee team (http://gravitee.io)

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<div class="gv-forms gv-forms" layout="column">
  <div class="gv-forms-header">
    <h1>Import Files</h1>
    <a ng-click="$ctrl.cancel()">Back to Documentation</a>
  </div>
  <div class="gv-form">
    <h2></h2>
    <div class="gv-form-content" layout="column">
      <div class="gv-page-draft-banner">
        <ng-md-icon icon="warning" class="gv-warning"></ng-md-icon>
        All files (with a supported page type) will be imported, generating one request by file to import.<br />
        If you use an external source with rate limiting, you can reach your maximum requests authorized.
      </div>

      <blockquote>
        <p style="font-size: 12px">
          <ng-md-icon icon="info" style="fill: grey"></ng-md-icon>
          You can import a whole directory (only available in few sources), or import a Gravitee.io descriptor (refer to the documentation).
          If the filepath is not filled, the root directory will be imported.
        </p>
      </blockquote>

      <gv-edit-page-fetchers
        fetchers="$ctrl.fetchers"
        page="$ctrl.page"
        title="'Select your source:'"
        with-publish-option="true"
      ></gv-edit-page-fetchers>

      <div class="md-actions gravitee-api-save-button" layout="row" style="padding-top: 32px">
        <md-button
          class="md-raised md-primary"
          type="submit"
          ng-click="$ctrl.import()"
          ng-disabled="!$ctrl.page.source.type || $ctrl.importInProgress"
        >
          Import
        </md-button>
      </div>
    </div>
  </div>
</div>
